package com.jyx.designpatterns.mediator;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ConcreteMediator mediator = new ConcreteMediator();//创建中介者对象
		ColleagueA colleagueA = new ColleagueA(mediator);
		ColleagueB colleagueB = new ColleagueB(mediator);
		ColleagueC colleagueC = new ColleagueC(mediator);
		
		colleagueA.setName("朝鲜");
		colleagueB.setName("日本");
		colleagueC.setName("韩国");
		String[] messA = {"要求日本进行战争赔款","要求把韩国兼并"};
		colleagueA.giveMess(messA);
		String[] messB = {"要求朝鲜不再核试验","要求韩国归还独岛"};
		colleagueB.giveMess(messB);
		String[] messC = {"韩国要求朝鲜禁止试射导弹","要求日本放弃独岛主权"};
		colleagueC.giveMess(messC);
		
	}

}
